#pragma once
#include "log.hpp"
#include <yaml-cpp/yaml.h>
#include <fstream>
#include <iostream>
#include <sstream>
#include <string>

namespace toolsLib
{
class getParam
{
  private:
    getParam() {}  // 私有构造函数;
    YAML::Node config;

  public:
    static getParam& getInstance()
    {
        static getParam instance;
        return instance;
    }
    void loadYamlFile(const std::string& file,
                      const std::string& funcName,
                      const int& line,
                      const std::string& paramPath);

    void getParameter(const std::string& file,
                      const std::string& funcName,
                      const int& line,
                      const std::string& param,
                      int& value);

    void getParameter(const std::string& file,
                      const std::string& funcName,
                      const int& line,
                      const std::string& param,
                      double& value);

    void getParameter(const std::string& file,
                      const std::string& funcName,
                      const int& line,
                      const std::string& param,
                      bool& value);

    void getParameter(const std::string& file,
                      const std::string& funcName,
                      const int& line,
                      const std::string& param,
                      std::string& value);
};
}  // namespace toolsLib